//
//  LoginWarningView.m
//  e律师
//
//  Created by 韦淋 on 2017/5/31.
//  Copyright © 2017年 test. All rights reserved.
//

#import "LoginWarningView.h"

@implementation LoginWarningView

- (instancetype)init
{
    self = [super init];
    if (self) {
        _noViewLable = [[UILabel alloc]init];
        _noViewLable.textAlignment = NSTextAlignmentCenter;
        _noViewLable.frame = CGRectMake(83, 280, 250, 60);
        _noViewLable.font = [UIFont systemFontOfSize:13];
        _noViewLable.textColor = [UIColor colorWithRed:102.0f/255.0f green:159.0f/255.0f blue:190.0f/255.0f alpha:1.0f];
        _noViewLable.backgroundColor = [UIColor whiteColor];
        _noViewLable.font = [UIFont systemFontOfSize:14];
        _noViewLable.layer.cornerRadius = 5;
        _noViewLable.layer.masksToBounds = YES;
        _noViewLable.alpha = 0;
    }
    return self;
}

- (void)wrongWarningWithString:(NSString *)string{
    _noViewLable.text = string;
    [[UIApplication sharedApplication].keyWindow addSubview:self.noViewLable];
    [UIView animateWithDuration:1 animations:^{
        _noViewLable.alpha = 1;
    } completion:^(BOOL finished) {
        _noViewLable.alpha = 0;
        [self.noViewLable removeFromSuperview];
    }];
}


@end
